<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <style>
        .layui-btn+.layui-btn{
            margin-left: 0;
        }
        .layui-table td, .layui-table th
        {
            min-width: 50px !important;
        }
.layui-btn-xs {
    height: 22px !important;
    line-height: 22px !important;
    padding: 0 5px !important;
    font-size: 12px;
}
    </style>
  </head>
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a><cite>{$nav}</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon layui-icon-refresh-3" style="line-height:30px"></i></a>
    </div>
    <div class="x-body x-admin">
        
      <xblock style="display: flex;">
        
        <div class="layui-card-body" style="padding-left: 0;float:left;padding-left:20px;padding-top:0;">
          <form class="layui-form layui-col-space5" action="" method="get">
            <!--<div class="layui-inline layui-show-xs-block">-->
              <!--<input style="width:260px;" type="text" name="keyword" id="keyword" value="{:input()['keyword']}" placeholder="活动名称，地点，手机号，营销姓名" autocomplete="off" class="layui-input">-->
            <!--</div>-->

              <div class="layui-inline layui-show-xs-block">
                  <select name="admin_id" id="admin_id" lay-search>
                      <option value="">营销员姓名</option>
                      {volist name="adminList" id="value"}
                      <option value="{$value.id}" {$value.id==input('admin_id')?'selected':''}>{$value.name}</option>
                      {/volist}
                  </select>
              </div>

              <div class="layui-inline">
                  <label>直播日期选择</label>
                  <div class="layui-input-inline">
                      <input type="text" name="start_date" id="start_date" value="{if condition="input('start_date')"}{:input('start_date')}{/if}" autocomplete="off" class="layui-input">
                  </div>
              </div>
              <div class="layui-inline">
                  <label>至</label>
                  <div class="layui-input-inline">
                      <input type="text" name="end_date" id="end_date" value="{if condition="input('end_date')"}{:input('end_date')}{/if}" autocomplete="off" class="layui-input">
                  </div>
              </div>

              <div class="layui-inline layui-show-xs-block">
                  <select name="step">
                      <option value="">是否结算</option>
                      <option value="4" {:input('step')==4?'selected':''}>待结算</option>
                      <option value="5" {:input('step')==5?'selected':''}>已结算</option>
                  </select>
              </div>

              <div class="layui-inline layui-show-xs-block">
                  <select name="jie_method" id="jie_method" lay-search>
                      <option value="">结算类型</option>
                      {volist name="jieMethodList" id="value"}
                      <option value="{$value}" {$value==input('jie_method')?'selected':''}>{$value}</option>
                      {/volist}
                  </select>
              </div>

              <div class="layui-inline layui-show-xs-block">
                  <select name="transferor" id="transferor" lay-search>
                      <option value="">结算人</option>
                      {volist name="transferorList" id="value"}
                      <option value="{$value}" {$value==input('transferor')?'selected':''}>{$value}</option>
                      {/volist}
                  </select>
              </div>

            <div class="layui-inline layui-show-xs-block">
              <button class="layui-btn" id="search-btn">搜索</button>
            </div>
          </form>
        </div>
      </xblock>
        <!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">-->
        <!--  <legend>直播申请表</legend>-->
        <!--</fieldset>-->
        <div class="layui-table-body layui-table-main" style="width: 100%;min-height:0;">
            <table class="layui-table layui-form" lay-filter="liveDetail" id="liveDetail"> </table>
        </div>
    </div>
    <script type="text/html" id="status-td">
    {{#  if(d.step == 0){ }}
    联系中
    {{#  } else if (d.step == 1){ }}
    待确认
    {{#  } else if (d.step == 2){ }}
    待审核

    {{#  } else if (d.step == 3 && d.activity_start_time > {:time()} ){ }}
    已审待播
    {{#  } else if (d.step == 3 && d.activity_end_time > {:time()} ){ }}
    执行中
    {{#  } else if (d.step == 3 && d.activity_end_time < {:time()} ){ }}
    执行完毕

    {{#  } else if (d.step == 4){ }}
    待结算
    {{#  } else if (d.step == 5){ }}
    已结算
    {{#  } else if (d.step == -1){ }}
    <span style="color:#f00" title="请删除或修改信息重新提交">撤销 !</span>
    {{#  } }}
    </script>

    <script>
      layui.use(['form','layer','jquery','table','util','laydate'], function(){
        form = layui.form,
        layer = layui.layer
        ,$ = layui.jquery
        ,table = layui.table
        ,util = layui.util
        ,laydate = layui.laydate;
        
          table.render({
            elem: '#liveDetail'
            ,url:'{:url('admin/dataTable/liveProcessSummary')}?step={:input('step')?:'4,5'}&admin_id={:input('admin_id')}&start_date={:input('start_date')}&end_date={:input('end_date')}&jie_method={:input('jie_method')}&transferor={:input('transferor')}'
            ,toolbar: '#toolbarDemo'
            ,defaultToolbar: ['filter', 'exports', 'print']
            ,limit: 50
            ,height: $(window).height()-150
            ,title: '直播汇总表'
            ,cols: [[
              //{field:'id', width:70, sort: true,title:"编号"},
              {field:'admin_name', width:80,title:"营销人",fixed: 'left' },
              {field:'live_id',width:80,title:"活动ID",fixed: 'left' },
              {field:'activity_name', width:180,title:"活动名称",fixed: 'left' },
              {field: 'liveer_price', width:110,title:"报价"},
              {field: 'jie_price', width:110,title:"结算价"},
              {field: 'jie_method', width:160,title:"结算类型"},
              {field: 'transferor', width:160,title:"结算人"},
//              {field:'activity_date', width:160,title:"直播日期",fixed: 'left' },
//              {field:'activity_time', width:110,title:"直播时间段",fixed: 'left' },
              {field:'activity_area', width:180,title:"地区"},
//              {field:'activity_venues', width:100,title:"活动场馆"},
//              {field:'activity_address', width:180,title:"场馆地址"},
              {field:'activity_need_device', width:120,title:"设备需求"},
              {field:'note', width:150,title:"备注"},
              {fixed: 'right', width:100,title:"状态",  toolbar: '#status-td'},
//              {fixed: 'right', width:160,title:"操作",  toolbar: '#do-td'},
            ]],
            // 给第一行 添加背景色
            done: function(){
                $("#liveDetail").next().find('tbody tr[data-index=0]').css("background-color", "#FFA07A");
            }

            ,page: true
          });

          laydate.render({
              elem: '#start_date'
          });
          laydate.render({
              elem: '#end_date'
          });

      });

    </script>
  </body>

</html>